<?php
namespace app\admin\validate;
use think\Validate;

class Admin extends Validate{
    protected $rule = [
        'username' => 'require|unique:admin|max:10',
        'password' => 'require|min:6'
    ];

    protected $message = [
        'username.require' => '管理员名称不能为空',
        'username.max' => '管理员名称最多不能超过10个字符',
        'username.unique' => '管理员名称已存在！',

        'password.require' =>'密码不能为空',
        'password.min' => '密码不得小于6个字符',
//        'password.number' =>'密码必须是数字',
    ];

    protected $scene = [
        'edit'  =>  ['username'],
    ];


}